package Test2;

public class Test02 {
    public static void main(String[] args) {
        long start=System.currentTimeMillis();
        long nanoStart=System.nanoTime();
        int num=0;
        for (int i = 1; i < 321782; i++) {
            num+=i;
            
        }
        long end=System.currentTimeMillis();
        long nanoEnd=System.nanoTime();
        System.out.println("从1加到321782总共耗时："+(end-start)+"毫秒");
        System.out.println("从1加到321782总共耗时："+(nanoEnd-nanoStart)+"纳秒");
    }
}
